/// @Classname : HcOutlineButton
/// @Author :
/// @Time : 2023-10-25 15:00
/// @Description : 有边框 无颜色 的按钮

import 'package:flutter/material.dart';
import 'package:hc_ui/config/hc_customer_config.dart';
import 'package:hc_ui/theme/hc_common_theme.dart';
import 'package:hc_ui/widget/button/hc_base_button.dart';

class HcOutlinedButton extends StatelessWidget {
  final String? text;
  final VoidCallback? onPressed;
  final VoidCallback? longPress;
  final Widget? child;
  final bool disabled;
  final bool loading;
  final Color? textColor;
  final Color? disabledTextColor;
  final Color? borderColor;
  final BorderRadius? borderRadius;
  final double? borderWidth;
  final EdgeInsets? padding;
  final double? fontSize;
  final Size? minSize;
  final Size? maxSize;
  final int maxLines;

  const HcOutlinedButton({
    super.key,
    required this.text,
    required this.onPressed,
    this.longPress,
    this.child,
    this.disabled = false,
    this.loading = false,
    this.textColor,
    this.disabledTextColor,
    this.borderRadius,
    this.borderColor,
    this.borderWidth,
    this.padding,
    this.fontSize,
    this.minSize,
    this.maxSize,
    this.maxLines = 1,
  });

  @override
  Widget build(BuildContext context) {
    HcCommonTheme comm = HcCustomerConfig().allTheme.commonTheme;
    return HcBaseButton.outline(
        text: text,
        onPressed: onPressed,
        longPress: longPress,
        disabled: disabled,
        loading: loading,
        minSize: minSize,
        maxSize: maxSize,
        fontSize: fontSize,
        padding: padding,
        maxLines: maxLines,
        disabledTextColor: disabledTextColor,
        textColor: textColor ?? comm.primaryColor,
        borderColor: borderColor ?? comm.borderColor,
        borderWidth: borderWidth ?? comm.lineBase,
        borderRadius: borderRadius,
        child: child);
  }
}
